package com.yequan.designpattern.factory.simplefactory.common;

import com.yequan.designpattern.factory.Product1A;
import com.yequan.designpattern.factory.Product1B;
import com.yequan.designpattern.factory.Product1C;
import com.yequan.designpattern.factory.IProduct1;

public class SimpleFactory {

    public static final int PRODUCT_A = 1;
    public static final int PRODUCT_B = 2;
    public static final int PRODUCT_C = 3;

    public static IProduct1 createProduct(int type) {
        switch (type) {
            case PRODUCT_A:
                return new Product1A();
            case PRODUCT_B:
                return new Product1B();
            case PRODUCT_C:
            default:
                return new Product1C();
        }
    }

}
